//
//  KLLog.m
//  KiklinkApp
//
//  Created by LF on 14-10-8.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "KLLog.h"

void KLLogStringWithFormat(NSString* formate, NSObject* content)
{
#ifdef KL_DEBUG
    NSLog(formate, content);
#endif
}

void KLLogString(NSObject* content)
{
    KLLogStringWithFormat(@"%@", content);
}

void KLLogWithFormat(NSObject* launcher, NSString* formate, NSObject* content)
{
    NSString* className = NSStringFromClass([launcher class]);
    NSString* contentString = [NSString stringWithFormat:formate, content];
    NSString* resultString = [NSString stringWithFormat:@"%@: %@", className, contentString];
    KLLogString(resultString);
}

void KLLog(NSObject* launcher, NSObject* content)
{
    KLLogWithFormat(launcher, @"%@", content);
}

void KLLogStaticWithFormat(Class launcher, NSString* formate, NSObject* content)
{
    NSString* className = NSStringFromClass(launcher);
    NSString* contentString = [NSString stringWithFormat:formate, content];
    NSString* resultString = [NSString stringWithFormat:@"%@: %@", className, contentString];
    KLLogString(resultString);
}

void KLLogStatic(Class launcher, NSObject* content)
{
    KLLogStaticWithFormat(launcher, @"%@", content);
}


//Verbose系列，仅在打开 KK_DEBUG_VERBOSE 时启用，用于输出常规的网络信息等

void KLLogVerboseStringWithFormat(NSString* formate, NSObject* content)
{
#ifdef KL_DEBUG
#ifdef KL_DEBUG_VERBOSE
    NSLog(formate, content);
#endif
#endif
}

void KLLogVerboseString(NSObject* content)
{
    KLLogVerboseStringWithFormat(@"%@", content);
}

void KLLogVerboseWithFormat(NSObject* launcher, NSString* formate, NSObject* content)
{
    NSString* className = NSStringFromClass([launcher class]);
    NSString* contentString = [NSString stringWithFormat:formate, content];
    NSString* resultString = [NSString stringWithFormat:@"%@: %@", className, contentString];
    KLLogVerboseString(resultString);
}

void KLLogVerbose(NSObject* launcher, NSObject* content)
{
    KLLogVerboseWithFormat(launcher, @"%@", content);
}

void KLLogVerboseStaticWithFormat(Class launcher, NSString* formate,NSObject* content)
{
    NSString* className = NSStringFromClass(launcher);
    NSString* contentString = [NSString stringWithFormat:formate, content];
    NSString* resultString = [NSString stringWithFormat:@"%@: %@", className, contentString];
    KLLogVerboseString(resultString);
}

void KLLogVerboseStatic(Class launcher, NSObject* content)
{
    KLLogVerboseStaticWithFormat(launcher, @"%@", content);
}
